package com.aaa.order.factory;

import com.aaa.order.feign.ProductFeign;
import entity.Product;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ProductFeignFactory implements FallbackFactory<ProductFeign> {

    @Override
    public ProductFeign create(Throwable cause) {
        return new ProductFeign() {
            @Override
            public Product getById(Long pid) {
                Product product=new Product();
                return product ;
            }
        };
    }
}
